<!-- <template>
	<view class="order-detail">
		<view class="header">
			<text>{{records.userAddr.receiver}}</text> <text>{{records.userAddr.mobile}}</text>
			<view class="">
				{{records.userAddr.province}}{{records.userAddr.city}}{{records.userAddr.area}}{{records.userAddr.area}}{{records.userAddr.addr}}
			</view>
		</view>
		<view class="main">
			
		</view>
		<view class="dd">
			
		</view>
		<view class="fs">
			
		</view>
		<view class="jg">
			
		</view>
	</view>
</template>

<script>
	var http = require("../../utils/http");
	export default {
		data() {
			return {
				records:{
					userAddr:{
					}
				},
				
			}
		},
		onLoad(option){
			http.request({
				url: "/p/myOrder/orderDetail",
				method: "get",
				data: {
					orderNumber:option.orderNum
				},
				callBack: res => {
					this.records = res
					console.log(this.records);
					// console.log(this.swiperList, "232431");
				}
			})
		},
		methods: {
			
		}
	}
</script>

<style>

</style -->>


<template>
	<view>
		<!--1  -->
		<view class="" style="padding: 10px;background: white;">
			<view class="" style="">
				<image src="../../static/images/icon/addr.png" mode=""
					style="width: 16px;height: 16px;margin-right: 6px;"></image>
				<text style="margin-right: 15px;font-weight: 400;">{{list.userAddr.receiver}}</text>
				<text style="margin-right: 15px;font-weight: 400;">{{list.userAddr.mobile}}</text>
			</view>
			<view class="" style="font-size: 12px;color: #999;margin-left: 20px;">
				{{list.userAddr.province}}{{list.userAddr.city}}{{list.userAddr.area}}{{list.userAddr.addr}}
			</view>
		</view>
		<!--1  -->
		<!-- 2 -->
		<view class="" v-if="list.shopCartOrders[0].shopCartItemDiscounts.length>0">
			<view class="" v-for="(item,index) in list.shopCartOrders[0].shopCartItemDiscounts[0].shopCartItems"
				:key="index">
				<view class="box-con" style="margin: 10px 0; padding: 10px; background-color:white;display: flex;">
					<image :src="item.pic" style="width: 80px;
					height: 80px;"></image>
					<view class="bxo-con-right">
						<view class="right-h">
							{{item.prodName}}
						</view>
						<view class="right-p">
							{{item.skuName}}
						</view>
						<view class="right-foot">
							<text>￥{{item.price}}<text>.00</text> </text>
							<text>x{{item.prodCount}}</text>
						</view>
					</view>
				</view>


			</view>
		</view>
		<view class="box-foot">
			共{{list.totalCount}}件商品 合计：￥{{list.total }}<text>.00</text>
		</view>
		<!-- 2 -->

		<!--  3-->
		<view class="" style="padding: 10px;background: white;">
			<view class="" style="margin:10px 0; display: flex;justify-content: space-between;">
				<text style="color: #999; margin-right: 15px;font-weight: 200;">优惠券： 暂无可用</text>
				<text>0张 ></text>
			</view>
			<view class="" style="margin-top:20px;">
				<text style="color: #999; font-weight: 200;">买家留言：</text> <input type="text" v-model="value"
					placeholder="给买家留言" style="display: inline-block; font-size: 12px; vertical-align: middle;" />
			</view>


		</view>
		<!-- 3 -->
		<!--  4-->

		<!-- 4 -->
		<!--  4-->
		<view class="" style=" padding: 10px;background: white;margin-bottom: 10px;">
			<view class="" style="margin:10px 0;display: flex;justify-content: space-between;">
				<view class="" style="color: #999; margin-right: 15px;font-weight: 200;">
					订单总额：
				</view>
				<view class="" style="color: red;">
					￥<text style="font-size: 20px;">{{list.total}}</text>.00
				</view>
			</view>
			<view class="" style="margin:10px 0;display: flex;justify-content: space-between;">
				<view class="" style="color: #999; margin-right: 15px;font-weight: 200;">
					运费： </view>
				<view class="" style="color: red;">
					￥<text style="font-size: 20px;">{{list.transfee}}</text>.00
				</view>
			</view>
			<view class="" style="margin:10px 0;display: flex;justify-content: space-between;">
				<view class="" style="color: #999; margin-right: 15px;font-weight: 200;">
					优惠卷：
				</view>
				<view class="" style="color: red;">
					-￥<text style="font-size: 20px;">{{list.reduceAmount}}</text>.00
				</view>
			</view>

			<view class="" style="border-bottom: 1px solid #f1f1f1;">

			</view>
			<view class="" style="color: red; width: 100%;padding: 20px 5px;text-align: right;">
				实付款： ￥<text style="font-size: 20px;">{{list.total}}</text>.00
			</view>
		</view>

		<!-- 4 -->
		<view class="foot">
			<view class="foot-left" style="color: #f00;">
				合计：￥<text style="font-size: 20px;">{{list.total}}</text>.00
			</view>
			<view class="foot-right" @click="handleJs">
				提交订单
			</view>
		</view>
	</view>
</template>

<script>
	var http = require("../../utils/http");
	export default {
		data() {
			return {
				list: {
					total: "",
					totalCount: "",
					userAddr: {},
					shopCartOrders: [] // 初始化为一个空数组
				},
				ids: '',
				value: "",
				orderNumbers: ""
			}
		},
		onLoad(option) {
			if (option.orderEntry == 1) {
				this.handleClickK()
			}else{
				this.handleClick()
			}



		},
		onShow() {
			this.handleClick()
		},
		methods: {
			// 提交订单
			handleJs() {
				http.request({
					url: "/p/order/submit",
					method: "post",
					data: {
						orderShopParam: [{
							remarks: this.value,
							shopId: 1
						}]
					},
					callBack: res => {
						this.orderNumbers = res.orderNumbers
						uni.redirectTo({
							url: `/pages/pay-result/pay-result?sts=1&orderNumbers=${res.orderNumbers}`
						})
					},
				})
			},
			handleTZ(row) {
				console.log(row, "跳转");
				// 跳转非tabar页面
				uni.navigateTo({
					// 跳转传参
					url: `/pages/prod/prod?prodid=${row}`
				})
			},

			// 默认调用
			handleClickK() {
				// 默认调用
				const value = uni.getStorageSync('orderItem');
				http.request({
					url: "/p/order/confirm",
					method: "POST",
					data: {
						addrId: 0,
						couponIds: [],
						orderItem: value,
						userChangeCoupon: 1,
					},
					callBack: res => {
						console.log(res, "我免费了");
						this.list = res


					},

				})
				// 默认调用
			},
			handleClick() {
				const basketIds = uni.getStorageSync('basketIds')
				http.request({
					url: "/p/order/confirm",
					method: "post",
					data: {
						addrId: 0,
						basketIds: basketIds,
						couponIds: [],
						userChangeCoupon: 1
					},
					callBack: res => {
						console.log(res, "默认调用");
						this.list = res;
					},
				})
			},
			// 默认调用
		}
	}
</script>

<style lang="scss" scoped>
	.box-con {
		display: flex;
		justify-content: space-between;

		padding: 20px 0;
		padding: 10px;

		.bxo-con-right {
			width: 72%;
		}

		.right-h {
			height: 36px;
		}

		.right-p {
			height: 20px;
			margin-top: 10upx;
			color: #999;
		}

		.right-foot {
			display: flex;
			justify-content: space-between;
			align-items: center;

			text {
				&:nth-child(1) {
					font-size: 16px;

					text {
						font-size: 12px;
					}
				}

				&:nth-child(2) {
					color: #999;
				}
			}
		}
	}

	.box-foot {
		padding: 10px;
		text-align: right;
		font-size: 14px;
		border-bottom: 1px solid #eee;
		padding-bottom: 10px;

		text {
			font-size: 12px;
		}
	}

	.foot {
		position: fixed;
		bottom: 0px;
		right: 0;
		left: 0;
		background-color: #fff;
		height: 50px;
		display: flex;
		justify-content: space-between;

		.foot-left {
			line-height: 50px;
			padding-left: 10px;
			display: flex;

			checkbox {
				margin-right: 6px;
			}

			.del {
				margin: 0 10px;
				color: #f00;
			}

			.sum {
				color: #f00;

				text {
					font-size: 12px;
				}

			}
		}

		.foot-right {
			background-color: #f00;
			color: #fff;
			line-height: 50px;
			padding: 0 30px;
		}
	}
</style>